/**
 * 项目名：	Rumba Plan
 * 
 * 版权所有(C)，上海海鼎信息工程股份有限公司，2006，所有权利保留。
 * 
 * 文件名：	ProcessLog.java
 * 模块说明：	
 * 修改历史：
 * 2006-11-10 - lxm - 创建。
 */
package com.hd123.rumba.log;

import java.util.Date;

import com.hd123.rumba.domain.IDomain;
import com.hd123.rumba.exception.StringTooLongException;
import com.hd123.rumba.runtime.Persistent;

/**
 * 处理过程日志 | 实体 | 实现类
 * 
 * @author lxm
 * 
 */
public class ProcessLog extends Persistent implements IProcessLog {

  private IDomain domain;
  private String processClassName;
  private String processUuid;
  private String processCaption;
  private String ownerKey1;
  private String ownerKey2;
  private String ownerKey3;
  private String ownerKey4;
  private int itemNo;
  private Date startTime;
  private String operator;
  private Date time = new Date();
  private Integer type = CProcessLog.VALUE_TYPE_INFO;
  private String loggerName;
  private String message;

  public IDomain getDomain() {
    return domain;
  }

  public void setDomain(IDomain domain) {
    this.domain = domain;
  }

  public int getItemNo() {
    return itemNo;
  }

  public void setItemNo(int itemNo) {
    this.itemNo = itemNo;
  }

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) throws StringTooLongException {
    if (message != null)
      message = CProcessLog.truncate(message, CProcessLog.LENGTH_MESSAGE, "message",
          CProcessLog.CAPTION_MESSAGE);
    this.message = message;
  }

  public String getOperator() {
    return operator;
  }

  public void setOperator(String operator) throws StringTooLongException {
    if (operator != null)
      operator = CProcessLog.truncate(operator, CProcessLog.LENGTH_OPERATOR, "operator",
          CProcessLog.CAPTION_OPERATOR);
    this.operator = operator;
  }

  public String getOwnerKey1() {
    return ownerKey1;
  }

  public void setOwnerKey1(String ownerKey1) throws StringTooLongException {
    if (ownerKey1 != null)
      ownerKey1 = CProcessLog.truncate(ownerKey1, CProcessLog.LENGTH_OWNERKEY1, "ownerKey1",
          CProcessLog.CAPTION_OWNERKEY1);
    this.ownerKey1 = ownerKey1;
  }

  public String getOwnerKey2() {
    return ownerKey2;
  }

  public void setOwnerKey2(String ownerKey2) throws StringTooLongException {
    if (ownerKey2 != null)
      ownerKey2 = CProcessLog.truncate(ownerKey2, CProcessLog.LENGTH_OWNERKEY2, "ownerKey2",
          CProcessLog.CAPTION_OWNERKEY2);
    this.ownerKey2 = ownerKey2;
  }

  public String getOwnerKey3() {
    return ownerKey3;
  }

  public void setOwnerKey3(String ownerKey3) throws StringTooLongException {
    if (ownerKey3 != null)
      ownerKey3 = CProcessLog.truncate(ownerKey3, CProcessLog.LENGTH_OWNERKEY3, "ownerKey3",
          CProcessLog.CAPTION_OWNERKEY3);
    this.ownerKey3 = ownerKey3;
  }

  public String getOwnerKey4() {
    return ownerKey4;
  }

  public void setOwnerKey4(String ownerKey4) throws StringTooLongException {
    if (ownerKey4 != null)
      ownerKey4 = CProcessLog.truncate(ownerKey4, CProcessLog.LENGTH_OWNERKEY4, "ownerKey4",
          CProcessLog.CAPTION_OWNERKEY4);
    this.ownerKey4 = ownerKey4;
  }

  public String getProcessCaption() {
    return processCaption;
  }

  public void setProcessCaption(String processCaption) throws StringTooLongException {
    if (processCaption != null)
      processCaption = CProcessLog.truncate(processCaption, CProcessLog.LENGTH_PROCESSCAPTION,
          "processCaption", CProcessLog.CAPTION_PROCESSCAPTION);
    this.processCaption = processCaption;
  }

  public String getProcessClassName() {
    return processClassName;
  }

  public void setProcessClassName(String processClassName) throws StringTooLongException {
    if (processClassName != null)
      processClassName = CProcessLog.truncate(processClassName,
          CProcessLog.LENGTH_PROCESSCLASSNAME, "processClassName",
          CProcessLog.CAPTION_PROCESSCLASSNAME);
    this.processClassName = processClassName;
  }

  public String getProcessUuid() {
    return processUuid;
  }

  public void setProcessUuid(String processUuid) throws StringTooLongException {
    if (processUuid != null)
      processUuid = CProcessLog.truncate(processUuid, CProcessLog.LENGTH_PROCESSUUID,
          "processUuid", CProcessLog.CAPTION_PROCESSUUID);
    this.processUuid = processUuid;
  }

  public Date getStartTime() {
    return startTime;
  }

  public void setStartTime(Date startTime) {
    this.startTime = startTime;
  }

  public Date getTime() {
    return time;
  }

  public void setTime(Date time) {
    this.time = time;
  }

  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public String getLoggerName() {
    return loggerName;
  }

  public void setLoggerName(String loggerName) throws StringTooLongException {
    if (loggerName != null)
      loggerName = CProcessLog.truncate(loggerName, CProcessLog.LENGTH_LOGGERNAME, "loggerName",
          CProcessLog.CAPTION_LOGGERNAME);
    this.loggerName = loggerName;
  }

}
